<template lang="pug">
.page
  .ApplyInvoice
    Modal(
      width="300"
      v-model="isShowDataCheckModal"
      class-name="vertical-center-modal"
      footer-hide
    )
      .text-center.mt-20.mb-20.font-16.font-weight 数据已经核对完成了吗？
      .text-center.pb-10
        Button.ml-10.mr-10(@click="cancel") 关闭
        Button.ml-10.mr-10(type="primary" @click="ok") 确认
</template>

<script>
import { BillApi } from '@/api/Bill.api.js'
export default {
  name: 'ApplyInvoice',

  data () {
    return {
      isShowDataCheckModal: false,
      rowYear: '',
      rowMonth: ''
    }
  },

  watch: {
  },

  mounted () {
  },

  methods: {
    ok () {
      // this.isShowDataCheckModal = false
      var params = {
        customerId: this.$route.query.companyId,
        year: this.rowYear,
        month: this.rowMonth
      }
      BillApi.checkBill(params).then(res => {
        console.log('核对完成: ', res)
        if (res.status === 200 && res.data.success) {
          this.$Message.success(res.data.message)
          this.isShowDataCheckModal = false
          this.$emit('query')
        } else {
          this.$Message.error({
            content: res.data.message,
            duration: 10,
            closable: true
          })
        }
      })
    },

    cancel () {
      this.isShowDataCheckModal = false
    }
  }
}
</script>

<style lang="less" scope>
</style>
